// 定义所有自定义指令 控制页面元素渲染

// 是否有角色
import hasRole from './permission/hasRole'
// 是否有权限
import hasPermi from './permission/hasPermi'
// 弹窗拖拽
import dialogDrag from './dialog/drag'
// 拖拽弹窗高度 宽度
import dialogDragWidth from './dialog/dragWidth'
import dialogDragHeight from './dialog/dragHeight'
// 剪辑板
import clipboard from './module/clipboard'

// 引入的模块声明为自定义指令
const install = function(Vue) {
  Vue.directive('hasRole', hasRole)
  Vue.directive('hasPermi', hasPermi)
  Vue.directive('clipboard', clipboard)
  Vue.directive('dialogDrag', dialogDrag)
  Vue.directive('dialogDragWidth', dialogDragWidth)
  Vue.directive('dialogDragHeight', dialogDragHeight)
}

if (window.Vue) {
  window['hasRole'] = hasRole
  window['hasPermi'] = hasPermi
  Vue.use(install); // eslint-disable-line
}

// 导出
export default install
